<?php

namespace App\Http\Requests;

use App\Models\ClientUserTicket;
use Illuminate\Foundation\Http\FormRequest;

class PasswordBackRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'mobile'				=> 'bail|required|size:11',
            'sms_code'				=> 'bail|required|min:4',
			'password'		    	=> 'bail|required|min:6|max:32|confirmed',
			'password_confirmation'=> 'required',
        ];
    }
    
    public function messages()
	{
		return [
			'mobile.required'			=> '请填写11位手机号码',
			'mobile.size'				=> '请填写11位手机号码',
			'sms_code.required'			=> '请填写短信验证码',
			'sms_code.min'				=> '请填写短信验证码',
			'password.required'		    => '请填写新登录密码',
			'password.min'			    => '新登录密码最少为6位数',
			'password.max'		    	=> '新登录密码超出最大字符限制',
			'password.confirmed'	    => '两次密码输入不一致',
			'password_confirmation.required'	=> '请再次输入密码',
		];
	}
}
